<div class="reports index">
	<h2><?php echo __('Reports'); ?></h2>


	<table>
		<th><h3>Taxed Portfolios</h3></th>
		<th><h3>RPM Charts</h3></th>
		<th><h3>Return Charts</h3></th>
		<th><h3>Send Email</h3></th>

		<tr>

	<!--Taxed Portfolios Date Selection-->	
		<td>
	<?php
	echo $this->Form->create('TaxedPortfolioDate');
	$dateoption1 = array();
	$con = mysql_connect("localhost","root","");
	$db = mysql_select_db ("dfs", $con);
	$query = mysql_query("SELECT DISTINCT date FROM indices ORDER BY date desc"); 
	// Loop through the query results, outputing the options one by one 
	while ($row = mysql_fetch_array($query)) 
	{ 
	?>
		<?php $dateoption1 = Set::insert($dateoption1, $row[0], $row[0]);
	} 
	echo $this->Form->input('date1', array('options'=>$dateoption1, 'label'=>''));
	//print_r($dateoption);
	echo $this->Form->End('Save As CSV');
	?>

		</td>

	<!--RPM Charts Date Selection-->	
		<td>
	<?php
	echo $this->Form->create('RPMChartDate');
	$dateoption2 = array();
	$con = mysql_connect("localhost","root","");
	$db = mysql_select_db ("dfs", $con);
	$query = mysql_query("SELECT DISTINCT date FROM modelportfolios ORDER BY date desc"); 
	// Loop through the query results, outputing the options one by one 
	while ($row = mysql_fetch_array($query)) 
	{ 
	?>
		<?php $dateoption2 = Set::insert($dateoption2, $row[0], $row[0]);
	} 
	echo $this->Form->input('date2', array('options'=>$dateoption2, 'label'=>''));
	//print_r($dateoption);
	echo $this->Form->End('Save As CSV');
	?>

		</td>
	<!--Return Charts Date Selection-->	
		<td>
	<?php
	echo $this->Form->create('ReturnChartDate');
	$dateoption3 = array();
	$con = mysql_connect("localhost","root","");
	$db = mysql_select_db ("dfs", $con);
	$query = mysql_query("SELECT DISTINCT date FROM modelportfolios ORDER BY date desc"); 
	// Loop through the query results, outputing the options one by one 
	while ($row = mysql_fetch_array($query)) 
	{ 
	?>
		<?php $dateoption3 = Set::insert($dateoption3, $row[0], $row[0]);
	} 
	echo $this->Form->input('date3', array('options'=>$dateoption3, 'label'=>''));
	//print_r($dateoption);
	echo $this->Form->End('Save As PDF');
	?>
		</td>
	<td>
	<?php 
		$counter=$this->Session->read("counter"); 
		if($this->Session->read('login')=='yes')
		{

		echo $this->Html->link(__('Email'), array('controller'=>'mailinglists', 'action' => 'email'), array('target'=>'_blank')); }?>

	</td>
	</tr>
</table>

</div>
